extract method refactoring in c